package cn.tsmchina.one.dao.menu;

import java.util.List;

import org.springframework.stereotype.Repository;

import cn.tsmchina.one.dao.BaseDaoSupport;
import cn.tsmchina.one.domain.menu.Menu;

@Repository
public class MenuDaoImpl extends BaseDaoSupport<Menu> implements MenuDao
{

	@Override
	public Menu getMenu(String menuName)
	{
		String hql = "from Menu where name = ?";
		return (Menu) find(hql, menuName);
	}

	@Override
	public Menu getMenu(Long menuId)
	{
		return findById(menuId);
	}
	
	@Override
	public List<Menu> getAll() {
		
		return super.lists();
	}
}
